<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="menu.xsl" />
<xsl:include href="footer.xsl" />
<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" method="xml" encoding="iso-8859-1" />
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
  <head>
    <title>Manager Framework users</title>
  	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  
  	<link rel="stylesheet" href="public/manager/css/manager.css" type="text/css" media="screen" />
  	<link rel="stylesheet" href="public/manager/css/users.css" type="text/css" media="screen" />
  
  	<script type="text/javascript" src="public/manager/js/prototype.js"></script>
  	<script type="text/javascript" src="public/manager/js/scriptaculous.js?load=effects"></script>
  	<script type="text/javascript" src="public/manager/js/lightbox.js"></script>
  	<script type="text/javascript" src="public/manager/js/alias.js"></script>
  	<script type="text/javascript" src="public/manager/js/users.js"></script>
  	<script type="text/javascript" src="public/manager/js/menu.js"></script>

  </head>
  <body>
  
  
    <div id="header">
    	<img id="logo" src="public/manager/images/bando.png" alt="inovia" />  
    </div>
    <div id="date">
      <xsl:value-of select=".//site/date" />
    </div>
    
    <!--<ul id="menu">
    	<li><a href="index.php?action=homeManager">Home</a></li>
    	<li><a class="active" href="index.php?action=homeUsers">Users</a></li>
    	<li><a href="index.php?action=homeMonitoring">Monitoring</a></li>
    	<li><a href="index.php?action=homeScaffolding">Scaffolding</a></li>
    	<li><a  href="index.php?action=homeUpdates">Updates</a></li>
    </ul>-->
    <xsl:call-template name="displayMenu">
      <xsl:with-param name="selectedMenu" select="string('users')"/>
    </xsl:call-template>
    
    
    <div id="PageLeft">
    
      <div id="menutaches">
        <h2>Actions</h2>
        <ul style="margin-left:-15px">
          <a href="index.php?action=addUser"><img src="public/manager/images/stock_new.png" alt="new user" title="new user"/></a>Add an user<br/>
        </ul>
        <hr/>
        <h2>Existing groups</h2>
          <ul>
            <xsl:for-each select=".//site/groups/group">
              <li><xsl:value-of select="text()" /></li>
            </xsl:for-each>
          </ul>
      </div>
    
    
      <div id="content">
        <h1 id="pageName" style="width:500px;">   Users   </h1> 
        <xsl:variable name="nbUsers" select="count(//site/users/user)" />
        <xsl:variable name="page" select="//site/navigation/page" />
        <xsl:variable name="numpage" select="//site/navigation/numpage" />
        <xsl:variable name="order" select="//site/navigation/order" />
        <xsl:variable name="orderkind" select="//site/navigation/orderkind" />
        <xsl:variable name="parameter" select="//site/navigation/parameter/@param" />
        <xsl:variable name="value" select="//site/navigation/parameter" />
    		<xsl:if test="$nbUsers=0">
    		  No user
    		 </xsl:if>
    		 <xsl:variable name="nbError" select="count(//error)" />
    		<xsl:if test="$nbError!=0">
    		  <p>
    		  <xsl:for-each select=".//error">
        		  <xsl:value-of select="text" /><br/>
          </xsl:for-each>  
          </p>
    		 </xsl:if>
    		 
    		 <xsl:variable name="deleted" select="count(//deleted)" />
    		 <xsl:if test="$deleted!=0">
    		   <p>The user has been deleted</p>
    		 </xsl:if>
    		 
    		 <xsl:variable name="inserted" select="count(//inserted)" />
    		 <xsl:if test="$inserted!=0">
    		   <p class="important">The user has been added</p>
    		 </xsl:if>
    		 
    		 <xsl:variable name="umodified" select="count(//usermodified)" />
    		 <xsl:if test="$umodified!=0">
    		   <p class="important">The user has been edited</p>
    		 </xsl:if>
    		 
    		 <xsl:variable name="insertedGroup" select="count(//insertedGroup)" />
    		 <xsl:if test="$insertedGroup!=0">
    		   <p class="important">The group has been added</p>
    		 </xsl:if>
    		 
    		 <xsl:variable name="deletedGroup" select="count(//deletedGroup)" />
    		 <xsl:if test="$deletedGroup!=0">
    		   <p class="important">The group has been deleted</p>
    		 </xsl:if>
    		 
    		 <div style="margin:10px 0 0 20px;width:770px;padding:0px;border:1px dotted #AAAAAA;background-color:#ECF3E1;">
    		 <div id="Pages">
	         <div class="Paginator">
	           
	           <xsl:variable name="prev" select="//site/navigation/previous/text()" />
	           <xsl:variable name="prevl" select="$page - 1" />
             <xsl:choose>
      		      <xsl:when test="$prev = 'disabled'">
      		        <span class="AtStart">&lt; Prev</span>
	              </xsl:when><xsl:otherwise>
                  <a href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$prevl}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}" class="Prev">&lt; Prev</a>
                </xsl:otherwise>
          		</xsl:choose>
	           
	           
      		   <xsl:for-each select="//site/navigation/pageslinks/pagelink">
    		     <xsl:variable name="mystate" select="./@state" />
    		     <xsl:variable name="mypage" select="./pagelink/text()" />
      		    <xsl:choose>
      		      <xsl:when test="$mystate = 'active'">
          		    <span class="break" ><xsl:value-of select="text()" /></span> 
          		  </xsl:when>
          		  <xsl:otherwise>
          		    <a class="pageList" href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={text()}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"><xsl:value-of select="text()" /></a> 
          		  </xsl:otherwise>
          		</xsl:choose>
             </xsl:for-each>
             
             
    		     <xsl:variable name="next" select="//site/navigation/next/text()" />
             <xsl:choose>
      		      <xsl:when test="$next = 'disabled'">
      		        <span class="AtEnd">Next &gt;</span>
	              </xsl:when><xsl:otherwise>
                  <a href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page+1}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}" class="Next">Next &gt;</a>
                </xsl:otherwise>
          		</xsl:choose>
           
           </div>
        	<div class="Results">
            <font color="#ff9900"><xsl:value-of select="//site/navigation/numresults/text()" /></font> results 
            displayed per : 
            <a class="perpage" href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page}&amp;numpage=25&amp;parameter={$parameter}&amp;value={$value}">25</a> - 
            <a class="perpage" href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page}&amp;numpage=50&amp;parameter={$parameter}&amp;value={$value}">50</a> - 
            <a class="perpage" href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page}&amp;numpage=100&amp;parameter={$parameter}&amp;value={$value}">100</a> - 
            <a class="perpage" href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page}&amp;numpage=200&amp;parameter={$parameter}&amp;value={$value}">200</a>
            <xsl:if test="$parameter != ''">filtered by  : 
  		        <font color="#ff9900"><xsl:value-of select="//site/navigation/parameter/@param" /></font> LIKE 
  		        <font color="#ff9900"><xsl:value-of select="//site/navigation/parameter/text()" /></font><a  href="index.php?action=homeUsers&amp;order={$order}&amp;orderkind={$orderkind}&amp;page={$page}&amp;numpage={$numpage}" title="disable">X</a>
              
  		      </xsl:if>
  		      </div>
        </div>	
           
    		   <div style="text-align:right;margin-bottom:5px;">
            </div>
      		 <table style="width:755px;padding:0px;spacing:0px;border:0px;">
            <tr id="trnav" style="background-color:#C2C9C9;font-weight:bold;">
      		    <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">Id</span>
                <a  class="arrowdesc"  href="index.php?action=homeUsers&amp;order=id&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}" alt="desc"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=id&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}" alt="asc"></a>
              </td>
      		    <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">User</span>
                <a class="arrowdesc" href="index.php?action=homeUsers&amp;order=user&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=user&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
              </td>
      		    <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">Group</span>
                <a class="arrowdesc" href="index.php?action=homeUsers&amp;order=group&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=group&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
              </td>
      		    <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">Email</span>
                <a class="arrowdesc" href="index.php?action=homeUsers&amp;order=email&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=email&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
              </td>
              <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">Code</span>
                <a class="arrowdesc" href="index.php?action=homeUsers&amp;order=code&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=code&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
              </td>
              <td>
                <span class="users_column" onclick="makeFormRequest(this,'{$order}','{$orderkind}','{$page}','{$numpage}')">lastlogin</span>
                <a class="arrowdesc" href="index.php?action=homeUsers&amp;order=lastlogin&amp;orderkind=asc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
                <a class="arrowasc" href="index.php?action=homeUsers&amp;order=lastlogin&amp;orderkind=desc&amp;page={$page}&amp;numpage={$numpage}&amp;parameter={$parameter}&amp;value={$value}"></a>
              </td>
      		    <td style="text-align:center">Actions</td>
      		  </tr>
            <xsl:for-each select=".//site/users/user">
        		  <tr>
        		    <td><xsl:value-of select="id" /></td>
        		    <td><xsl:value-of select="user" /></td>
        		    <td><xsl:value-of select="group" /></td>
        		    <td><xsl:value-of select="email" /></td>
        		    <td><xsl:value-of select="code" /></td>
        		    <td><xsl:value-of select="lastlogin" /></td>
                <td style="text-align:center">
                  <xsl:variable name="username" select="user" />
                  <a href="index.php?action=editUser&amp;id={id}"><img src="public/manager/images/stock_edit-16.png" alt="edit" title="edit"/></a>
                  <a style="margin-left:10px;" href="javascript:if(confirm('Delete {$username}\n\nAre you sure ?')) window.location='index.php?action=deleteUser&amp;id={id}'"><img src="public/manager/images/stock_delete-16.png" alt="delete" title="delete"/></a>
                  
                </td>
        		  </tr>
            </xsl:for-each>
          </table>
        </div>
      </div>
    </div>
    <xsl:call-template name="displayFooter" />
  </body>
</html>
</xsl:template>
 </xsl:stylesheet>

